<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>工作流-mxGraph</title>
    <style type="text/css">
      html,
      body {
        margin: 0;
        overflow: hidden;
      }
      .div-mxGraph {
        width: 100%;
        height: 100vh;
        border: 1px solid #ccc;
        position: relative;
      }

      /*滚动条*/
      ::-webkit-scrollbar {
        width: 12px;
        height: 12px;
      }

      ::-webkit-scrollbar-thumb {
        border-width: 2px;
        border-style: solid;
        border-color: #fff;
        border-radius: 6px;
        background-color: #c6c6c6;
      }

      ::-webkit-scrollbar-thumb:hover {
        background: #999;
      }

      /*预览框*/
      .outline-container {
        z-index: 1;
        position: absolute;
        overflow: hidden;
        top: 0px;
        right: 0px;
        width: 160px;
        height: 120px;
        background: transparent;
        border-style: solid;
        border-color: lightgray;
      }

      /*流程图*/
      .graph-container {
        position: absolute;
        overflow-y: auto;
        overflow-x: auto;
        left: 70px;
        top: 0px;
        right: 0px;
        bottom: 0px;
        background: url('../../images/mxGraph/grid.png');
      }

      /*工具栏*/
      .toolbar {
        position: absolute;
        overflow: hidden;
        padding: 10px;
        left: 0px;
        top: 0px;
        width: 70px;
        bottom: 0px;
        background: #f6f6f6;
        border-right: 1px solid #a2a2a2;
      }

      .toolbar span {
        display: block;
        height: 30px;
        line-height: 30px;
        font-size: 24px;
        text-align: center;
      }

      .toolbar img {
        width: 50px;
        height: 50px;
        cursor: pointer;
      }

      /*右键菜单*/
      .mxPopupMenu hr {
        margin-top: 8px;
        margin-bottom: 8px;
        color: #9a9a9a;
        border-top: 1px solid #9a9a9a;
      }
    </style>
  </head>
  <body>
    <div class="div-mxGraph">
      <!-- 工具栏 -->
      <div id="toolbar" class="toolbar">
        <img id="startNode" src="./images/mxGraph/start-node.png" />
        <span>开始</span>
        <img id="auditNode" src="./images/mxGraph/audit-node.png" />
        <span>节点</span>
        <img id="endNode" src="./images/mxGraph/end-node.png" />
        <span>结束</span>
        <button type="button" class="btn btn-primary btn-sm" onclick="save();">保存</button>
      </div>
      <!-- 预览框 -->
      <div id="outlineContainer" class="outline-container"></div>
      <!-- 流程图 -->
      <div id="graphContainer" class="graph-container"></div>
    </div>

    <!-- https://github.com/jgraph/mxgraph -->
    <script src="./lib/jquery.min.js"></script>
    <script type="text/javascript">
      //设置资源路径
      var mxBasePath = './lib/mxgraph-4.2.2'
      //图片路径
      var baseImgSrc = './images/mxGraph/'
    </script>
    <script src="./lib/mxgraph-4.2.2/js/mxClient.js"></script>
    <script src="./js/mxGraphDemo.js" asp-append-version="true"></script>
  </body>
</html>
